/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model.bll;

import entity.Account;
import java.util.List;
import model.dal.AccountDAL;

/**
 *
 * @author Hailk_c00639
 */
public class AccountBLL {

    AccountDAL accountDAL = new AccountDAL();

    public List<Account> getAllAccount() {
        return accountDAL.getAllAccount();
    }

    public Account getAccountByID(int id) {
        return accountDAL.getAccountByID(id);
    }

    public Account getAccountByName(String accountName) {
        return accountDAL.getAccountByName(accountName);
    }

    public boolean insertAccount(Account acc) {
        return accountDAL.insertAccount(acc);
    }

    public boolean updateAccount(Account acc) {
        return accountDAL.updateAccount(acc);
    }

    public boolean deleteAccountByID(int id) {
        try {
            accountDAL.deleteAccountByID(id);

            return true;
        } catch (Exception e) {
            return false;
        }
    }

    public List<Account> searchAccountByName(String accName) {
        return accountDAL.searchAccountByName(accName);
    }
}
